<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>EasyCharts</title>
        <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
    </head>
    <body>       
        <form action="checklogin.php" method="post">
            <div id="content">
                <div id="top">
                    <div id="logo" style="cursor: pointer;" onclick="window.location = '';">EasyCharts</div>
                </div>
                <div class="line"> </div>
                <div style="width: 100%;">
                    <div style="float: left; width: 200px; padding-top: 35px; padding-bottom: 15px; text-align: left; padding-left: 50px">
                        <img src="img/EasyChartsLogo1.png" alt=""/>
                    </div>
                    <div style="float: left; width: 450px; padding-bottom: 0px; text-align: left; padding-left: 100px">
                        <br/>
                        <div class="formular" style="padding-left: 50px; padding-top: 15px; border-left: 1px solid #eee">
                            <div class="title">Userlogin</div>
                            <?php
                            session_start();

                            // If already logged in go to overview page
                            if (isset($_SESSION["valid_email"])) {
                                header("Location: overview.php");
                            }

                            // If wronglogin the show messagebox
                            if (isset($_SESSION["wronglogin"])) {
                                if ($_SESSION["wronglogin"] == 1) {
                                    echo '<div class="errorbox" id="sw">Wrong email or password<br/></div><br/>';
                                    $_SESSION["wronglogin"] = 0;
                                }
                            }
                            ?>
                            <div class="field_block">
                                <div class="label">E-mail</div>
                                <div class="input"><input type="text" name="email" id="emailinput" value="" class="textfield" style="width: 250px;"/></div>
                            </div>
                            <div class="field_block">
                                <div class="label">Password</div>
                                <div class="input"><input type="password" name="password" id="passwordinput" class="textfield" style="width: 150px;"/></div>
                            </div>
                            <div class="field_block">
                                <div class="label">&nbsp;</div>
                                <div class="input"><input type="checkbox" class="checkboxfield" name="remember" id="remember" value="true"/>Save login</div>
                            </div>
                            <div class="field_block">
                                <div class="label">&nbsp;</div>
                                <div class="input"><input type="submit" name="submit" value="Log in" id="submit"/><span></span></div>
                            </div>				
                        </div>
                    </div>
                    <div class="line"></div>
                    <div id="footer" style="float: left;">Version: 1.0.0</div>
                    <div id="footer" style="float: right;">Copyright © 2011 - <a href="http://www.microcom.dk" target="_blank">Microcom</a></div>
                </div>
            </div>
        </form>
</body>
</html>